home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / f / fieldsofbattlereg1.dms / fieldsofbattlereg1.adf / Install < prev    next >
Text File  |  1995-09-13  |  15KB  |  523 lines

  1. ;---------------------------------------------------------------------------
  2. ;  Script to Install Fields of Battle
  3. ;  Registered Version 1.2 
  4. ;  Copyright ©1995 Bevelstone Production I/S
  5. ;  All rights reserved.
  6. ;---------------------------------------------------------------------------
  7.  
  8. ;--------Check OS version---------------------------------------------------
  9.  
  10. (set osversion (/ (getversion) 65536))
  11.  
  12. (if (< osversion 36)
  13.   (abort "\n\nYou must have Kickstart 2.0 and\n\nWorkbench 2.0 or newer\n\n"
  14.          "to run Fields of Battle.")
  15. )
  16.  
  17. ;--------Welcome------------------------------------------------------------
  18.  
  19. (message
  20.   "\n\nFields of Battle\nVersion 1.2\n\n"
  21.   "Please read the file \"license.txt\"\n\n"
  22.   "Proceeding now indicates your acceptance of these terms and conditions."
  23. )
  24.  
  25. ;--------Where to place fob-------------------------------------------------
  26.  
  27. (set fobdir
  28.   (askdir
  29.     (prompt "Where to place the Fields of Battle directory ?")
  30.     (help @askdir-help)
  31.     (default @default-dest)
  32.   )
  33. )
  34.  
  35. (set @default-dest fobdir)
  36. (set fobdir (tackon fobdir "Fields of Battle"))
  37.  
  38. ;--------Check for disk space-----------------------------------------------
  39.  
  40. (set disk_space (getdiskspace @default-dest))
  41. (if (> disk_space 0)
  42.   (if (< disk_space 9000000)
  43.     (abort "Not enough free disk space, need 9 MB")
  44.   )
  45. )
  46.  
  47. ;--------Detect CPU---------------------------------------------------------
  48.  
  49. (set install_opts -1)
  50. (set cpu_str (database "cpu"))
  51. (set fpu_str "")
  52.  
  53. (if (exists "c:cpu")
  54.   (
  55.     (if (not (run "cpu check 68881")) (set fpu_str "68881"))
  56.     (if (not (run "cpu check 68882")) (set fpu_str "68882"))
  57.   )
  58. )
  59.  
  60. (if (= cpu_str "68000")
  61.   (set install_opts %0001)
  62. )
  63.  
  64. (if (= cpu_str "68010")
  65.   (set install_opts %0001)
  66. )
  67.  
  68. (if (= cpu_str "68020")
  69.   (set install_opts %0010)
  70. )
  71.  
  72. (if (= cpu_str "68030")
  73.   (
  74.     (set install_opts %0100)
  75.     (if (= fpu_str "")
  76.       (set install_opts %0010)
  77.     )
  78.   )
  79. )
  80.  
  81. (if (= cpu_str "68040")
  82.   (set install_opts %1000)
  83. )
  84.  
  85. (if (= cpu_str "68060")
  86.   (set install_opts %1000)
  87. )
  88.  
  89. ;--------Select executeble files--------------------------------------------
  90.  
  91. (set install_opts
  92.   (askoptions
  93.     (prompt
  94.       "Please select which versions to install ?\n\n"
  95.       ("Detected CPU: %s, FPU: %s\n" cpu_str fpu_str)
  96.     )
  97.     (choices "68000 (any amiga)" "68020" "68030 FPU" "68040 FPU")
  98.     (default install_opts)
  99.     (help
  100.       "To make Fields of Battle run optimal on of your computer we have "
  101.       "included 4 different version of the Fields of Battle program file. "
  102.       "Using these options you can select which version to install on your "
  103.       "harddisk.\nNormaly you will just use the version suggested by this "
  104.       "install program.\n\nFacts:\n\n"
  105.       "  68000*     -  Any M680x0 CPU\n"
  106.       "                commodore ieee math library.\n"
  107.       "  68020      -  min. M68020 CPU\n"
  108.       "                commodore ieee math library.\n"
  109.       "  68030 FPU  -  min. M68030 CPU\n"
  110.       "                inlined M68881/M68882 math.\n"
  111.       "  68040 FPU  -  min. M68040 CPU\n"
  112.       "                inlined M68881/M68882 math.\n\n"
  113.       " *This version is not compiled with optimizing, because of a bug in"
  114.       " the SAS/C 6.55 compiler."
  115.     )
  116.   )
  117. )
  118.  
  119. (if (= install_opts 0)
  120.   (message "\nNo executable file selected.\nYou won't be able to run\nFields of Battle\nif you continue.")
  121. )
  122.  
  123.  
  124. ;--------Check for fonts----------------------------------------------------
  125.  
  126. (set font_name "")
  127.  
  128. (if (not (exists "FONTS:CGTimes.font"))
  129.   (
  130.     (set result 
  131.       (askchoice
  132.         (prompt "\nYou don't have the font \"CGTimes.font\".\n")
  133.         (choices "Find alternate font." "Ignore.")
  134.         (help 
  135.           "Fields of Battle is normally using the vector font "
  136.           "\"CGTimes.font\", but you don't have this font installed.\n"
  137.           "The \"CGTimes.font\" font should be on your Workbench disks. We "
  138.           "recommand that you abort the this installation and install the "
  139.           "font from the Workbench disks (See Amiga manuals for details.).\n"
  140.           "If you select \"Find alternate font\" you will get a list of "
  141.           "available font form which you must select one. (Fields of Battle"
  142.           " open this font in 4 sizes 12, 16, 24 and 32 so a bitmap font"
  143.           " might get ugly when scaled.)\n"
  144.           "Selecting \"Ignore\" you can continue this installation and then "
  145.           "install the font afterwards.\n"
  146.           "Note: Fields of Battle get the font name from the program icon's "
  147.           "tooltypes, so you can always change font bye changing tooltypes. "
  148.           "By using the tooltypes it is also possible to use different font "
  149.           "in Fields of Battle."
  150.         )
  151.       )
  152.     )
  153.     (if (= result 0)
  154.       (
  155.         (set result (run "list >t:installer-font.lst fonts:#?.font lformat \"%n\" "))
  156.         (if (not (= result 0))
  157.           (message "Can't build font list\nPlease set tooltypes after install.")
  158.         )
  159.         (if (= result 0)
  160.           (
  161.             (run "fob_disk_1:listpick \"Fields of Battle - Install\" \"Select alternate font\" \"t:installer-font.lst\" \"installer-result\"  ")
  162.             (set new_font (getenv "installer-result"))
  163.           )
  164.         )
  165.         (set font_name new_font)
  166.       )
  167.     )
  168.   )
  169. )
  170.  
  171.  
  172. ;--------Install starts here------------------------------------------------
  173.  
  174.  
  175. (makedir fobdir (infos))
  176. (makedir (tackon fobdir "games"))
  177. (makeassign "fob_dest" fobdir)
  178.  
  179. ;--------Disk 1-------------------------------------------------------------
  180.  
  181. (copyfiles (source "unzip") (dest "T:"))
  182.  
  183. (copyfiles (source "read.me") (dest "fob_dest:") (infos))
  184. (copyfiles (source "license.txt") (dest "fob_dest:") (infos))
  185.  
  186.  
  187. (complete 0)
  188.  
  189. (if (bitand install_opts %0001)
  190.   (
  191.     (working "Unpacking files from disk 1.\n\nExecutable file for 68000")
  192.     (set result (run "t:unzip -o -qq FOB_DISK_1:fobexe0.zip -d fob_dest:"))
  193.     (if (not (= result 0))
  194.       (
  195.         (set errtxt ("\nCan't UnZip file: \"fobexe0.zip\"\n\nUnZip return code: %ld " result))
  196.         (abort errtxt)
  197.       )
  198.     )
  199.     (if (not (= font_name ""))
  200.       (
  201.         (tooltype
  202.           (dest "fob_dest:Fields of Battle")
  203.           (settooltype "TYPEFACE12" font_name)
  204.         )
  205.         (tooltype
  206.           (dest "fob_dest:Fields of Battle")
  207.           (settooltype "TYPEFACE16" font_name)
  208.         )
  209.         (tooltype
  210.           (dest "fob_dest:Fields of Battle")
  211.           (settooltype "TYPEFACE24" font_name)
  212.         )
  213.         (tooltype
  214.           (dest "fob_dest:Fields of Battle")
  215.           (settooltype "TYPEFACE32" font_name)
  216.         )
  217.         (tooltype
  218.           (dest "fob_dest:Fields of Battle")
  219.           (settooltype "(TYPEFACE12")
  220.         )
  221.         (tooltype
  222.           (dest "fob_dest:Fields of Battle")
  223.           (settooltype "(TYPEFACE16")
  224.         )
  225.         (tooltype
  226.           (dest "fob_dest:Fields of Battle")
  227.           (settooltype "(TYPEFACE24")
  228.         )
  229.         (tooltype
  230.           (dest "fob_dest:Fields of Battle")
  231.           (settooltype "(TYPEFACE32")
  232.         )
  233.       )
  234.     )
  235.   )
  236. )
  237. (complete 6)
  238.  
  239. (if (bitand install_opts %0010)
  240.   (
  241.     (working "Unpacking files from disk 1.\n\nExecutable file for 68020")
  242.     (set result (run "t:unzip -o -qq FOB_DISK_1:fobexe2.zip -d fob_dest:"))
  243.     (if (not (= result 0))
  244.       (
  245.         (set errtxt ("\nCan't UnZip file: \"fobexe2.zip\"\n\nUnZip return code: %ld " result))
  246.         (abort errtxt)
  247.       )
  248.     )
  249.     (if (not (= font_name ""))
  250.       (
  251.         (tooltype
  252.           (dest "fob_dest:Fields of Battle (020)")
  253.           (settooltype "TYPEFACE12" font_name)
  254.         )
  255.         (tooltype
  256.           (dest "fob_dest:Fields of Battle (020)")
  257.           (settooltype "TYPEFACE16" font_name)
  258.         )
  259.         (tooltype
  260.           (dest "fob_dest:Fields of Battle (020)")
  261.           (settooltype "TYPEFACE24" font_name)
  262.         )
  263.         (tooltype
  264.           (dest "fob_dest:Fields of Battle (020)")
  265.           (settooltype "TYPEFACE32" font_name)
  266.         )
  267.         (tooltype
  268.           (dest "fob_dest:Fields of Battle (020)")
  269.           (settooltype "(TYPEFACE12")
  270.         )
  271.         (tooltype
  272.           (dest "fob_dest:Fields of Battle (020)")
  273.           (settooltype "(TYPEFACE16")
  274.         )
  275.         (tooltype
  276.           (dest "fob_dest:Fields of Battle (020)")
  277.           (settooltype "(TYPEFACE24")
  278.         )
  279.         (tooltype
  280.           (dest "fob_dest:Fields of Battle (020)")
  281.           (settooltype "(TYPEFACE32")
  282.         )
  283.       )
  284.     )
  285.   )
  286. )
  287. (complete 12)
  288.  
  289.  
  290. ;--------Disk 2-------------------------------------------------------------
  291.  
  292. (askdisk
  293.   (prompt "\n\n\nPlease insert the disk labeled \"Disk 2\".")
  294.   (help @askdisk-help);
  295.   (dest "FOB_DISK_2")
  296.   (assigns)
  297. )
  298. (working "Unpacking files from disk 2.\n\nScreenMd tool, options.")
  299. (set result (run "t:unzip -o -qq FOB_DISK_2:fobroot.zip -d fob_dest:"))
  300. (if (not (= result 0))
  301.   (
  302.     (set errtxt ("\nCan't UnZip file: \"fobroot.zip\"\n\nUnZip return code: %ld " result))
  303.     (abort errtxt)
  304.   )
  305. )
  306. (complete 14)
  307.  
  308.  
  309. (if (bitand install_opts %0100)
  310.   (
  311.     (working "Unpacking files from disk 2.\n\nExecutable file for 68030 FPU")
  312.     (set result (run "t:unzip -o -qq FOB_DISK_2:fobexe3.zip -d fob_dest:"))
  313.     (if (not (= result 0))
  314.       (
  315.         (set errtxt ("\nCan't UnZip file: \"fobexe3.zip\"\n\nUnZip return code: %ld " result))
  316.         (abort errtxt)
  317.       )
  318.     )
  319.     (if (not (= font_name ""))
  320.       (
  321.         (tooltype
  322.           (dest "fob_dest:Fields of Battle (030fp)")
  323.           (settooltype "TYPEFACE12" font_name)
  324.         )
  325.         (tooltype
  326.           (dest "fob_dest:Fields of Battle (030fp)")
  327.           (settooltype "TYPEFACE16" font_name)
  328.         )
  329.         (tooltype
  330.           (dest "fob_dest:Fields of Battle (030fp)")
  331.           (settooltype "TYPEFACE24" font_name)
  332.         )
  333.         (tooltype
  334.           (dest "fob_dest:Fields of Battle (030fp)")
  335.           (settooltype "TYPEFACE32" font_name)
  336.         )
  337.         (tooltype
  338.           (dest "fob_dest:Fields of Battle (030fp)")
  339.           (settooltype "(TYPEFACE12")
  340.         )
  341.         (tooltype
  342.           (dest "fob_dest:Fields of Battle (030fp)")
  343.           (settooltype "(TYPEFACE16")
  344.         )
  345.         (tooltype
  346.           (dest "fob_dest:Fields of Battle (030fp)")
  347.           (settooltype "(TYPEFACE24")
  348.         )
  349.         (tooltype
  350.           (dest "fob_dest:Fields of Battle (030fp)")
  351.           (settooltype "(TYPEFACE32")
  352.         )
  353.       )
  354.     )
  355.   )
  356. )
  357. (complete 19)
  358.  
  359. (if (bitand install_opts %1000)
  360.   (
  361.     (working "Unpacking files from disk 2.\n\nExecutable file for 68040 FPU")
  362.     (set result (run "t:unzip -o -qq FOB_DISK_2:fobexe4.zip -d fob_dest:"))
  363.     (if (not (= result 0))
  364.       (
  365.         (set errtxt ("\nCan't UnZip file: \"fobexe4.zip\"\n\nUnZip return code: %ld " result))
  366.         (abort errtxt)
  367.       )
  368.     )
  369.     (if (not (= font_name ""))
  370.       (
  371.         (tooltype
  372.           (dest "fob_dest:Fields of Battle (040fp)")
  373.           (settooltype "TYPEFACE12" font_name)
  374.         )
  375.         (tooltype
  376.           (dest "fob_dest:Fields of Battle (040fp)")
  377.           (settooltype "TYPEFACE16" font_name)
  378.         )
  379.         (tooltype
  380.           (dest "fob_dest:Fields of Battle (040fp)")
  381.           (settooltype "TYPEFACE24" font_name)
  382.         )
  383.         (tooltype
  384.           (dest "fob_dest:Fields of Battle (040fp)")
  385.           (settooltype "TYPEFACE32" font_name)
  386.         )
  387.         (tooltype
  388.           (dest "fob_dest:Fields of Battle (040fp)")
  389.           (settooltype "(TYPEFACE12")
  390.         )
  391.         (tooltype
  392.           (dest "fob_dest:Fields of Battle (040fp)")
  393.           (settooltype "(TYPEFACE16")
  394.         )
  395.         (tooltype
  396.           (dest "fob_dest:Fields of Battle (040fp)")
  397.           (settooltype "(TYPEFACE24")
  398.         )
  399.         (tooltype
  400.           (dest "fob_dest:Fields of Battle (040fp)")
  401.           (settooltype "(TYPEFACE32")
  402.         )
  403.       )
  404.     )
  405.   )
  406. )
  407. (complete 25)
  408.  
  409. ;--------Disk 3-------------------------------------------------------------
  410.  
  411. (askdisk
  412.   (prompt "\n\n\nPlease insert the disk labeled \"Disk 3\".")
  413.   (help @askdisk-help);
  414.   (dest "FOB_DISK_3")
  415.   (assigns)
  416. )
  417. (working "Unpacking files from disk 3.\n\nData files..")
  418. (set result (run "t:unzip -o -qq FOB_DISK_3:fobdir1.zip -d fob_dest:"))
  419. (if (not (= result 0))
  420.   (
  421.     (set errtxt ("\nCan't UnZip file: \"fobdir1.zip\"\n\nUnZip return code: %ld " result))
  422.     (abort errtxt)
  423.   )
  424. )
  425. (complete 37)
  426.  
  427. ;--------Disk 4-------------------------------------------------------------
  428.  
  429. (askdisk
  430.   (prompt "\n\n\nPlease insert the disk labeled \"Disk 4\".")
  431.   (help @askdisk-help);
  432.   (dest "FOB_DISK_4")
  433.   (assigns)
  434. )
  435. (working "Unpacking files from disk 4.\n\nData files..")
  436. (set result (run "t:unzip -o -qq FOB_DISK_4:fobdir2.zip -d fob_dest:"))
  437. (if (not (= result 0))
  438.   (
  439.     (set errtxt ("\nCan't UnZip file: \"fobdir2.zip\"\n\nUnZip return code: %ld " result))
  440.     (abort errtxt)
  441.   )
  442. )
  443. (complete 50)
  444.  
  445. ;--------Disk 5-------------------------------------------------------------
  446.  
  447. (askdisk
  448.   (prompt "\n\n\nPlease insert the disk labeled \"Disk 5\".")
  449.   (help @askdisk-help);
  450.   (dest "FOB_DISK_5")
  451.   (assigns)
  452. )
  453. (working "Unpacking files from disk 5.\n\nData files..")
  454. (set result (run "t:unzip -o -qq FOB_DISK_5:fobdir3.zip -d fob_dest:"))
  455. (if (not (= result 0))
  456.   (
  457.     (set errtxt ("\nCan't UnZip file: \"fobdir3.zip\"\n\nUnZip return code: %ld " result))
  458.     (abort errtxt)
  459.   )
  460. )
  461. (complete 62)
  462.  
  463. ;--------Disk 6-------------------------------------------------------------
  464.  
  465. (askdisk
  466.   (prompt "\n\n\nPlease insert the disk labeled \"Disk 6\".")
  467.   (help @askdisk-help);
  468.   (dest "FOB_DISK_6")
  469.   (assigns)
  470. )
  471. (working "Unpacking files from disk 6.\n\nData files..")
  472. (set result (run "t:unzip -o -qq FOB_DISK_6:fobdir4.zip -d fob_dest:"))
  473. (if (not (= result 0))
  474.   (
  475.     (set errtxt ("\nCan't UnZip file: \"fobdir4.zip\"\n\nUnZip return code: %ld " result))
  476.     (abort errtxt)
  477.   )
  478. )
  479. (complete 75)
  480.  
  481. ;--------Disk 7-------------------------------------------------------------
  482.  
  483. (askdisk
  484.   (prompt "\n\n\nPlease insert the disk labeled \"Disk 7\".")
  485.   (help @askdisk-help);
  486.   (dest "FOB_DISK_7")
  487.   (assigns)
  488. )
  489. (working "Unpacking files from disk 7.\n\nData files..")
  490. (set result (run "t:unzip -o -qq FOB_DISK_7:fobdir5.zip -d fob_dest:"))
  491. (if (not (= result 0))
  492.   (
  493.     (set errtxt ("\nCan't UnZip file: \"fobdir5.zip\"\n\nUnZip return code: %ld " result))
  494.     (abort errtxt)
  495.   )
  496. )
  497. (complete 87)
  498.  
  499. ;--------Disk 8-------------------------------------------------------------
  500.  
  501. (askdisk
  502.   (prompt "\n\n\nPlease insert the disk labeled \"Disk 8\".")
  503.   (help @askdisk-help);
  504.   (dest "FOB_DISK_8")
  505.   (assigns)
  506. )
  507. (working "Unpacking files from disk 8.\n\nData files..")
  508. (set result (run "t:unzip -o -qq FOB_DISK_8:fobdir6.zip -d fob_dest:"))
  509. (if (not (= result 0))
  510.   (
  511.     (set errtxt ("\nCan't UnZip file: \"fobdir6.zip\"\n\nUnZip return code: %ld " result))
  512.     (abort errtxt)
  513.   )
  514. )
  515. (complete 100)
  516.  
  517.  
  518.  
  519. ;--------Cleanup------------------------------------------------------------
  520. (run "c:assign fob_dest:")
  521. (delete t:unzip)
  522.  
  523.